<include file="Admin/header"/>

<link rel="stylesheet" href="__PUBLIC__/Home/js/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="__PUBLIC__/Home/js/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/Home/js/kindeditor/lang/zh_CN.js"></script>
<div class="content">
	<empty name="dream_info.dream_title">
	添加梦想
	<else/>
	编辑梦想
	</empty>
  <div class="content_form">
		<input type="hidden" id="edit_member_id" value="{$simple_member_info.member_id}"/>
	    <p>
	      <label>梦想标题：</label>
	      <input type="text" maxlength="20" class="w250 h30 inputtext f16" id="dream_title" value="{$dream_info.dream_title}">
	      <input type="hidden" id="dream_id" value="{$dream_info.dream_id}">
	    </p>
	    <p class="rel">
	      <label style="float:left;">梦想内容：</label>
	      <div style="margin-left:128px;"><textarea maxlength="20" style="width:300px;height:150px;" name="dream_content" id="dream_content">{$dream_info.dream_content}</textarea></div>
	    </p>                                                                 
		<p class="center clear mt10">
		  <input type="submit" value="提交" class="submit" onclick="editSubmit();return false;">
	 	 <!-- <input type="submit" name="" class="submit" value="返回上一页" onclick="location.href='/Leadership/leadershipIndex.html'"> -->
		</p>
	</div>
</div>


<script type="text/javascript">
/*	$(function($) {
 	});
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="user_content"]', {
			allowFileManager : true,
			minWidth:400,
			minHeigth:600,
		});
	}); */

	function editSubmit(){
		var dream_title = $("#dream_title").val();
		var dream_content = $("#dream_content").val();
		var dream_id = $("#dream_id").val();
		if (dream_title == '' || dream_title == undefined) {
			art.dialog({content: '梦想名不能为空！'});
			return false;
		}

		if (dream_content == '' || dream_content == undefined) {
			art.dialog({content: '梦想内容不能为空！'});
			return false;
		}
		var json_data = {
			dream_title : dream_title,
			dream_content : dream_content,
			dream_id : dream_id
		}
//console.log(json_data);return false;
		$.post("/Admin/editDream?rand=" + Math.random(), json_data, function(data) {
			if (data.status == 'LEARN_1019') {
				art.dialog({content: data.info,time:1});
			}else {
				art.dialog({content: data.info,time:1});
			}
			return false;
		}, "json");
	}
</script>
<script type="text/javascript" src="__PUBLIC__/Home/js/tr.js"></script>
